<?php
require(dirname(__FILE__)."/includes/init.php");
if(isset($_SESSION['user_name'])){
$perPageNum = $GLOBALS['pageSize'];
$pageNum = isset($_REQUEST['pg'])?$_REQUEST['pg']:1;
$email = isset($_REQUEST['specify'])?$_REQUEST['specify']:NULL;
$type = isset($_REQUEST['type'])?$_REQUEST['type']:NULL;
$recordSet = isset($_REQUEST['recordSet'])?$_REQUEST['recordSet']:NULL;

$id = NULL;
$listArr = checkOpenRate($id,$pageNum,$email,$recordSet);

?><title>打开率</title>
<table width="1312" height="147" border="0" bgcolor="#0066FF">
  <tr bgcolor="#FFFFFF">
<form action="openRate.php" name="openRate" method="get">  
    <td>查询</td>
    <td colspan="3"><input name="specify" type="text" id="specify" size="35" />
        <input type="submit" value="get" />     </td>
</form>
<form action="openRate.php" name="openRate" method="get">  		
    <td>查询记录集</td>
    <td colspan="4"><input name="recordSet" type="text" id="recordSet" size="35" />
      <input type="submit" value="get" /></td>
</form>	  
  </tr>
  
  <tr bgcolor="#FFFFFF">
    <td width="64">id</td>
    <td width="189">address</td>
    <td width="76">country:province</td>
    <td width="113">语言</td>
    <td width="180">时间<br/><span style=" background:#990000; color:#FFFFFF"><?php echo date("Y-m-d H:i:s",time());?></span></td>
    <td width="36">打开</td>
    <td width="32">分组</td>
    <td width="535">系统</td>
    <td width="49">查看</td>
  </tr>
 <?php foreach($listArr as $key=>$value){?>   
  <tr bgcolor="#FFFFFF">
    <td><?php echo $value['id'];?></td>
    <td><?php echo $value['address'];?></td>
    <td><?php echo $value['country'].":".$value['province'];?></td>
    <td><?php echo $value['brownserLanguage'];?></td>
    <td><?php echo date("Y-m-d H:i:s",$value['timeStamps']);?></td>
    <td><?php if(!empty($email)){echo "1";}else{echo $value['num'];}?></td>
    <td><?php echo $value['type'];?></td>
    <td style="font-size:12px"><?php echo $value['brownserType'];?></td>
    <td><a href="openRate.php?specify=<?php echo $value['address'];?>" target="_blank">查看</a></td>
  </tr>
 <?php }?> 
  <tr bgcolor="#FFFFFF">
    <td colspan="9"><?php $totalNum = getOpenRateNum($email,$recordSet);
	$page = new Pager($totalNum[0],$perPageNum,$style="page");
	?></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td colspan="4"><?php include("includes/symbolic.htm");?></td>
    <td colspan="4">&nbsp;</td>
  </tr>
</table>
<?php
}else{
 echo "hello";
}
?>